//
//  VISTAMagaDetailCell.m
//  看杂志
//
//  Created by zcj on 15-12-14.
//  Copyright (c) 2015年 郑朝军. All rights reserved.
//

#import "VISTAMagaDetailCell.h"
#import "CatagerName.h"

@implementation VISTAMagaDetailCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self configCell];
    }
    return self;
}

- (void)configCell
{
    _cat_name_label = [[UILabel alloc]initWithFrame:CGRectMake(30, 5, 100, 25)];
    _star_imgView = [[UIImageView alloc]initWithFrame:CGRectMake(30, 34, 7, 7)];
    _title_label = [[UILabel alloc]initWithFrame:CGRectMake(40, 26, self.frame.size.width-80, 25)];
    _bg_imgView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, self.frame.size.width-10, 50)];
    
    _bg_imgView.image = [UIImage imageNamed:@"微话题列表底_1.png"];
    _star_imgView.image = [UIImage imageNamed:@"五角星_2.png"];
    _cat_name_label.textColor = [UIColor colorWithRed:0.78 green:0 blue:0 alpha:1];
    // _cat_name_label.font = [UIFont systemFontOfSize:13];
    //加粗
    _cat_name_label.font = [UIFont boldSystemFontOfSize:13];
    
    _title_label.textColor = [UIColor blackColor];
    _title_label.font = [UIFont systemFontOfSize:12];
    
    self.backgroundColor = [UIColor clearColor];
    
    [self.contentView addSubview:_bg_imgView];
    [self.contentView addSubview:_cat_name_label];
    [self.contentView addSubview:_title_label];
    [self.contentView addSubview:_star_imgView];
}
- (void)fillCellWithModel:(CatagerName *)model
{
    self.cat_name_label.text =[NSString stringWithFormat:@"%@",model.cat_name];
    VISTAMagaDetailModel * modelTwo = model.list[0];
    
    self.title_label.text = [NSString stringWithFormat:@"%@",modelTwo.title];
}
+ (VISTAMagaDetailCell *)cellWithTableView:(UITableView *)tableView
{
    static NSString *reuseID = @"magaDetailID";
    VISTAMagaDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseID];
    if (!cell) {
        cell = [[VISTAMagaDetailCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseID];
    }
    return cell;
}

@end
